export SGL_DISABLE_TP_MEMORY_INBALANCE_CHECK=True
PYTHONUNBUFFERED=1 python3 -m verl.trainer.main_ppo \
    data.train_files=/data/zhujunjie/datasets/convert_gsm8k/train.parquet \
    data.val_files=/data/zhujunjie/datasets/convert_gsm8k/test.parquet \
    data.train_batch_size=128 \
    data.max_prompt_length=1024 \
    data.max_response_length=2048 \
    data.truncation=left \
    actor_rollout_ref.rollout.name=sglang \
    actor_rollout_ref.model.path=/data/zhujunjie/models/Llama-3.1-8B-Instruct \
    actor_rollout_ref.actor.optim.lr=1e-6 \
    actor_rollout_ref.actor.ppo_mini_batch_size=128 \
    actor_rollout_ref.actor.ppo_micro_batch_size_per_gpu=16 \
    actor_rollout_ref.actor.use_dynamic_bsz=True \
    actor_rollout_ref.rollout.log_prob_micro_batch_size_per_gpu=16 \
    actor_rollout_ref.model.enable_gradient_checkpointing=True \
    actor_rollout_ref.model.use_remove_padding=True \
    critic.model.use_remove_padding=True \
    actor_rollout_ref.actor.fsdp_config.param_offload=True \
    actor_rollout_ref.actor.fsdp_config.optimizer_offload=True \
    actor_rollout_ref.rollout.tensor_model_parallel_size=2 \
    actor_rollout_ref.rollout.gpu_memory_utilization=0.3 \
    actor_rollout_ref.rollout.dtype=float16 \
    actor_rollout_ref.rollout.load_format=auto \
    actor_rollout_ref.rollout.temperature=0.0 \
    +actor_rollout_ref.rollout.speculative_algorithm=EAGLE3 \
    +actor_rollout_ref.rollout.speculative_draft_model_path=/data/zhujunjie/models/sglang-EAGLE3-Llama-3.1-Instruct-8B \
    +actor_rollout_ref.rollout.speculative_num_steps=4 \
    +actor_rollout_ref.rollout.speculative_eagle_topk=6 \
    +actor_rollout_ref.rollout.speculative_num_draft_tokens=16 \
    +actor_rollout_ref.rollout.enable_dynamic_spec=False \
    +actor_rollout_ref.rollout.migration_threshold=150000.0 \
    +actor_rollout_ref.ref.log_prob_micro_batch_size_per_gpu=16 \
    critic.optim.lr=1e-5 \
    critic.model.path=/data/zhujunjie/models/Llama-3.1-8B-Instruct \
    critic.ppo_micro_batch_size_per_gpu=16 \
    critic.model.fsdp_config.param_offload=True \
    critic.model.fsdp_config.optimizer_offload=True \
    algorithm.kl_ctrl.kl_coef=0.001 \
    trainer.logger=['console'] \
    trainer.val_before_train=False \
    trainer.default_hdfs_dir=null \
    trainer.n_gpus_per_node=8 \
    trainer.nnodes=1 \
    trainer.save_freq=-1 \
    trainer.test_freq=10 \
    trainer.total_epochs=1 2>&1 | tee verl_baseline_spec.log
